namespace CodeConsult.Nordic.nRF8001.ApplicationControlInterface.Commands.SystemCommands
{
    public class ChangeTimingRequestCommand : AciCommandBase
    {
        public const byte OpCode = 0x13;

        public ushort IntervalMin { get; set; }
        public ushort IntervalMax { get; set; }
        public ushort SlaveLatency{ get; set; }
        public ushort Timeout{ get; set; }

        protected override void EncodeBuffer()
        {
            EncodeBufferWithCommandHeader(OpCode, 8);
            EncodeHelper.SetUnsignedShort(IntervalMin, EncodeHelper.ByteOrder.LsbMsb);
            EncodeHelper.SetUnsignedShort(IntervalMax, EncodeHelper.ByteOrder.LsbMsb);
            EncodeHelper.SetUnsignedShort(SlaveLatency, EncodeHelper.ByteOrder.LsbMsb);
            EncodeHelper.SetUnsignedShort(Timeout, EncodeHelper.ByteOrder.LsbMsb);
        }
    }
}
